#coding:utf-8

from sqlalchemy import Column, String, Integer, DateTime, Text
from sqlalchemy.dialects.mysql import TIMESTAMP, TINYINT
from yxproject.views.utils.DB.MySQL.InitSqlalchemy import Base, db_session

class BgImg(Base):
    __tablename__ = 'bgimage'
    ID = Column(Integer, autoincrement=True, unique=True)
    MD5 = Column(String(32), primary_key=True)
    name = Column(String(128))
    description = Column(String(256))
    price = Column(Integer)
    path = Column(String(256))
    timestamp = Column(TIMESTAMP)
    image_source_type = Column(TINYINT(4))

class BgImgInfo(Base):
    __tablename__ = 'user_bgimage_info'
    ID = Column(Integer, autoincrement=True, unique=True)
    MD5 = Column(String(32), primary_key=True)
    user_id = Column(Integer, primary_key=True)
    timestamp = Column(TIMESTAMP)
